package com.hb.trade.api.routine.controller.project.fee;

import io.swagger.annotations.Api;
import lombok.extern.slf4j.Slf4j;
import org.fzzn.core.web.anno.Version;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 费用交纳(退款)记录API控制器
 *
 * @author Lix1ang
 * @date 2022-2-11 16:30:44
 */
@Slf4j
@Version(1.0)
@Api(tags = {"费用交纳(退款)记录"})
@RequestMapping("/{version}")
@RestController
@Deprecated
public class ApiFeeRecordController {
/*
    protected final FeeClient feeClient;

    public ApiFeeRecordController(FeeClient feeClient) {
        this.feeClient = feeClient;
    }

    *//**
     * 获取当前登录用户所在企业的费用缴纳信息
     *
     * @param feeRecord
     * @return
     *//*
    @ApiOperation(value = "投标方根据标段Id与投标人Id查询记录", httpMethod = "POST")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "sectionId", value = "标段Id", dataTypeClass = Long.class),
            @ApiImplicitParam(name = "feeType", value = "费用类型(1: 保证金  2: 履约保证金  3: 标书费  4: 报名费  5: 系统使用费)", dataTypeClass = Long.class)
    })
    @PostMapping("/feeRecord/getFeeRecord")
    public ResponseDto getFeeRecord(@RequestBody FeeRecord feeRecord) {
        Long sectionId = feeRecord.getSectionId();
        if (sectionId == null) {
            return ResultUtil.msg(MsgEnum.INCORRECT_PARAM);
        }

        Integer feeType = feeRecord.getFeeType();
        FeeTypeEnum feeTypeEnum = Enums.of(FeeTypeEnum.class, feeType);
        if (feeTypeEnum == null) {
            return ResultUtil.msg(MsgEnum.INCORRECT_PARAM);
        }

        feeRecord.setSectionId(sectionId);
        feeRecord.setOrgId(ShiroUtil.getOrgId());

        Message<FeeRecordDTO> message = feeClient.getFeeRecord(feeRecord);
        return ResultUtil.msg(message);
    }

    @ApiOperation(value = "费用缴纳记录保存", httpMethod = "POST")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "sectionId", value = "标段Id", dataTypeClass = Long.class),
            @ApiImplicitParam(name = "feeType", value = "费用类型(1: 保证金  2: 标书费  3: 报名费  4: 系统使用费)", dataTypeClass = Long.class)
    })
    @PostMapping("/feeRecord/saveFeeRecord")
    public ResponseDto saveFeeRecord(@RequestBody FeeRecord feeRecord) {
        Integer feeType = feeRecord.getFeeType();
        if (feeType == null) {
            return ResultUtil.msg(MsgEnum.INCORRECT_PARAM);
        }
        feeRecord.setBidderId(ShiroUtil.getUserId());
        ShiroUtil.fillOwner(feeRecord);
        Message message = feeClient.saveFeeRecord(feeRecord);
        return ResultUtil.msg(message);
    }

    @ApiOperation(value = "根据项目Id或者标段Id统计各状态数量", httpMethod = "POST")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "projectId", value = "项目Id", dataTypeClass = Long.class),
            @ApiImplicitParam(name = "sectionId", value = "标段Id", dataTypeClass = Long.class),
            @ApiImplicitParam(name = "feeType", value = "费用类型(1: 保证金  2: 标书费  3: 报名费  4: 系统使用费)", dataTypeClass = Long.class)
    })
    @PostMapping("/feeRecord/countFeeRecord")
    public ResponseDto countFeeRecord(@RequestBody FeeRecordDTO feeRecordDTO) {
        Integer feeType = feeRecordDTO.getFeeType();
        if (feeType == null) {
            return ResultUtil.msg(MsgEnum.INCORRECT_PARAM);
        }
        Message message = feeClient.countFeeRecord(feeRecordDTO);
        return ResultUtil.msg(message);
    }

    @ApiOperation(value = "获取费用交纳记录分页", httpMethod = "POST")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "projectId", value = "项目Id", dataTypeClass = Long.class),
            @ApiImplicitParam(name = "sectionId", value = "标段Id", dataTypeClass = Long.class),
            @ApiImplicitParam(name = "feeType", value = "费用类型(1: 保证金  2: 标书费  3: 报名费  4: 系统使用费)", dataTypeClass = Long.class)
    })
    @PostMapping("/feeRecord/pageFeeRecord")
    public ResponseDto pageFeeRecord(@RequestBody FeeRecordDTO feeRecord) {
        Integer feeType = feeRecord.getFeeType();
        if (feeType == null) {
            return ResultUtil.msg(MsgEnum.INCORRECT_PARAM);
        }
        Message message = feeClient.pageFeeRecord(feeRecord);
        return ResultUtil.msg(message);
    }

    @ApiOperation(value = "投标人获取费用交纳记录", httpMethod = "POST")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "projectId", value = "项目Id", dataTypeClass = Long.class),
            @ApiImplicitParam(name = "sectionId", value = "标段Id", dataTypeClass = Long.class)
    })
    @PostMapping("/feeRecord/pageFeeRecordByBidderId")
    public ResponseDto pageFeeRecordByBidderId(@RequestBody FeeRecordDTO feeRecord) {
        Long projectId = feeRecord.getProjectId();
        Long sectionId = feeRecord.getSectionId();
        if (projectId == null && sectionId == null) {
            return ResultUtil.msg(MsgEnum.INCORRECT_PARAM);
        }
        feeRecord.setBidderId(ShiroUtil.getUserId());
        Message message = feeClient.pageFeeRecord(feeRecord);
        return ResultUtil.msg(message);
    }

    @ApiOperation(value = "根据Id获取费用交纳记录", httpMethod = "POST")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "id", value = "主键Id", dataTypeClass = Long.class)
    })
    @PostMapping("/feeRecord/getFeeRecordById")
    public ResponseDto getFeeRecordById(@RequestBody FeeRecordDTO feeRecordDTO) {
        Message message = feeClient.getFeeRecordById(feeRecordDTO);
        return ResultUtil.msg(message);
    }

    @ApiOperation(value = "审核通过", httpMethod = "POST")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "id", value = "主键Id", dataTypeClass = Long.class)
    })
    @PostMapping("/feeRecord/pass")
    public ResponseDto pass(@RequestBody FeeRecordDTO feeRecordDTO) {
        Message message = feeClient.pass(feeRecordDTO);
        return ResultUtil.msg(message);
    }

    @ApiOperation(value = "审核驳回", httpMethod = "POST")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "id", value = "主键Id", dataTypeClass = Long.class)
    })
    @PostMapping("/feeRecord/reject")
    public ResponseDto reject(@RequestBody FeeRecordDTO feeRecordDTO) {
        Message message = feeClient.reject(feeRecordDTO);
        return ResultUtil.msg(message);
    }

    @ApiOperation(value = "退款", httpMethod = "POST")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "id", value = "主键Id", dataTypeClass = Long.class)
    })
    @PostMapping("/feeRecord/refund")
    public ResponseDto refund(@RequestBody FeeRecordDTO feeRecordDTO) {
        Message message = feeClient.refund(feeRecordDTO);
        return ResultUtil.msg(message);
    }

    @ApiOperation(value = "批量退款", httpMethod = "POST")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "ids", value = "主键Id集合", dataTypeClass = Long[].class)
    })
    @PostMapping("/feeRecord/batchRefund")
    public ResponseDto batchRefund(@RequestBody FeeRecordDTO feeRecordDTO) {
        Message message = feeClient.batchRefund(feeRecordDTO);
        return ResultUtil.msg(message);
    }*/
}
